import api from "./";
//获取推荐歌曲列表
export function getMusicView() {
  return api({
    method: "GET",
    url: "/personalized/newsong?limit=12",
  });
}
//获取banner图
// 0:pc 1:android 2:iphone 3:ipad
export function getBanner() {
  return api({
    method: "GET",
    url: "/banner?type=2",
  });
}
//搜索框
// 默认为 1 即单曲 , 取值意义 : 1: 单曲, 10: 专辑, 100: 歌手, 1000: 歌单, 1002: 用户, 1004: MV, 1006: 歌词, 1009: 电台, 1014: 视频, 1018:综合
export function getSearch(data, num = 30, page = 0, type = 1) {
  return api({
    method: "GET",
    url: `/search?keywords=${data}&limit=${num}&offse=${page}&type=${type}`,
  });
}
//默认搜索提示
export function getDefultSearch() {
  return api({
    method: "GET",
    url: `/search/default`,
  });
}
//获得歌单列表
export function getPlayList(data) {
  return api({
    method: "GET",
    url: `/personalized?limit=${data}`,
  });
}
//获得歌单详情
export function getPlayItemDetail(id) {
  return api({
    method: "GET",
    url: `/playlist/detail?id=${id}`,
  });
}
//获得歌单全部音乐
export function getPlaySongDetail(ids) {
  return api({
    method: "GET",
    url: `/song/detail?ids=${ids}`,
  });
}
//获取歌词
export function getMusicLyric(id) {
  return api({
    method: "GET",
    url: `/lyric?id=${id}`,
  });
}
//热搜列表(简略)
export function getHot() {
  return api({
    method: "GET",
    url: `/search/hot/detail`,
  });
}
//获取热门话题
export function getTopic(num = 20, page = 0) {
  return api({
    method: "GET",
    url: `/hot/topic?limit=${num}&offset=${page}&timeout=${new Date().getTime()}`,
  });
}
//每日推荐歌曲
export function getRecommend() {
  return api({
    method: "GET",
    url: `/recommend/songs`,
  });
}
//私人FM
export function getFM() {
  return api({
    method: "GET",
    url: `/personal_fm?timeout=${new Date().getTime()}`,
  });
}
//获取vip成长值
export function getVip() {
  return api({
    method: "GET",
    url: `/vip/growthpoint`,
  });
}
